﻿@model IEnumerable<Lavka.Models.Orders>

@{
    ViewBag.Title = "Заказы";
}

<h2>Заказы</h2>

@*<p>
    @Html.ActionLink("Создать заказ", "Create")
</p>*@
<div class="roundedTable">    
    <table id="productsTable" class="productsTable">
    <tr>
        <th></th>
        <th>
            Номер заказа
        </th>
        <th>
            Покупатель
        </th>
        <th>
            Дата заказа
        </th>
        <th>
            Самовывоз
        </th>
        <th>
            Выполнение
        </th>

    </tr>

@foreach (var item in Model)
{
        if (!item.Completed)
        {
                @:<tr class="non-complated-order">
        }
        else
        {
                @:<tr>
        }
        <td>
            @Html.ActionLink("Редактировать", "Edit", new { id = item.OrderId }) |
            @Html.ActionLink("Удалить", "Delete", new { id = item.OrderId })
        </td>
        <td>
            @Html.ActionLink(item.OrderId.ToString(), "Details", new { id = item.OrderId })
        </td>
        <td>
            @Html.ActionLink(item.Customers.Name, "Details", new { id = item.OrderId })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OrderDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Pickup)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Completed)
        </td>
        {
                @:</tr>
        }
}
</table>
</div>
